


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'subTask.label', default: 'SubTask')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${subTaskInstance}">
            <div class="errors">
                <g:renderErrors bean="${subTaskInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${subTaskInstance?.id}" />
                <g:hiddenField name="version" value="${subTaskInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                           
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="phaseName"><g:message code="subTask.phaseName.label" default="Phase Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: subTaskInstance, field: 'phaseName', 'errors')}">
                                    <g:textField name="phaseName" value="${subTaskInstance?.phaseName}" />
                                </td>
                            </tr>
                        
                         <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="estimatedTime"><g:message code="subTask.estimatedTime.label" default="Estimated Time" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: subTaskInstance, field: 'estimatedTime', 'errors')}">
                                    <g:textField name="estimatedTime" value="${fieldValue(bean: subTaskInstance, field: 'estimatedTime')}" />
                                </td>
                            </tr>
                        
                           
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="task"><g:message code="subTask.task.label" default="Task" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: subTaskInstance, field: 'task', 'errors')}">
                                  <g:select name="task.id"
					from="${Task.list()}" optionKey="id"
					value="${subTaskInstance?.task?.id}"
					optionValue="name" /> 
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="unitForPhase"><g:message code="subTask.unitForPhase.label" default="Unit For Phase" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: subTaskInstance, field: 'unitForPhase', 'errors')}">
                                    <g:textField name="unitForPhase" value="${fieldValue(bean: subTaskInstance, field: 'unitForPhase')}" />
                                </td>
                            </tr>
                            
                             <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="pspData"><g:message code="subTask.pspData.label" default="Psp Data" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: subTaskInstance, field: 'pspData', 'errors')}">
                                    
<ul>
<g:each in="${subTaskInstance?.pspData?}" var="p">
    <li><g:link controller="pspData" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="pspData" action="create" params="['subTask.id': subTaskInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'pspData.label', default: 'PspData')])}</g:link>

                                </td>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
